<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Navo Portable Library: navo/algorithm/hash/signature/sha256.c文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Navo Portable Library&#160;<span id="projectnumber">Ver 1.0.20120827</span></div>
   <div id="projectbrief">Provides generic platform independent facilities.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>数据结构</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>全局定义</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a> &#124;
<a href="#var-members">变量</a>  </div>
  <div class="headertitle">
<h1>navo/algorithm/hash/signature/sha256.c文件参考</h1>  </div>
</div>
<div class="contents">

<p>Implements for SHA-256.  
<a href="#_details">更多...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="sha256_8h_source.html">sha256.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="swab_8h_source.html">../../../port/swab.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="endian_8h_source.html">../../../port/endian.h</a>&quot;</code><br/>
</div>
<p><a href="sha256_8c_source.html">浏览该文件的源代码。</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
宏定义</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab0a0d1ad13c7e4d3cb38c89f7127c85a"></a><!-- doxytag: member="sha256.c::Ch" ref="ab0a0d1ad13c7e4d3cb38c89f7127c85a" args="(x, y, z)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>Ch</b>(x, y, z)&#160;&#160;&#160;((z) ^ ((x) &amp; ((y) ^ (z))))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a447cd1d7fb703b62666400976be24bf3"></a><!-- doxytag: member="sha256.c::Maj" ref="a447cd1d7fb703b62666400976be24bf3" args="(x, y, z)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>Maj</b>(x, y, z)&#160;&#160;&#160;(((x) &amp; (y)) | ((z) &amp; ((x) | (y))))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afe62ba9b21f70c5fcae4543340f93a28"></a><!-- doxytag: member="sha256.c::E0" ref="afe62ba9b21f70c5fcae4543340f93a28" args="(x)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>E0</b>(x)&#160;&#160;&#160;(__ror32_c(x, 2) ^ __ror32_c(x, 13) ^ __ror32_c(x, 22))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91ce68625b6932f82194f733f4581f5e"></a><!-- doxytag: member="sha256.c::E1" ref="a91ce68625b6932f82194f733f4581f5e" args="(x)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>E1</b>(x)&#160;&#160;&#160;(__ror32_c(x, 6) ^ __ror32_c(x, 11) ^ __ror32_c(x, 25))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4fe3c738087e923a3174ad2a116e3be5"></a><!-- doxytag: member="sha256.c::S0" ref="a4fe3c738087e923a3174ad2a116e3be5" args="(x)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>S0</b>(x)&#160;&#160;&#160;(__ror32_c(x, 7) ^ __ror32_c(x, 18) ^ (x &gt;&gt;  3))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a59c41bcd16cbf3247d426429c3bf8e08"></a><!-- doxytag: member="sha256.c::S1" ref="a59c41bcd16cbf3247d426429c3bf8e08" args="(x)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>S1</b>(x)&#160;&#160;&#160;(__ror32_c(x,17) ^ __ror32_c(x, 19) ^ (x &gt;&gt; 10))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>ROUND</b>(a, b, c, d, e, f, g, h, t1, t2, I)</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
函数</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1bdec2be484e29d52e9a6e7cfde3122b"></a><!-- doxytag: member="sha256.c::__sha256_load_op" ref="a1bdec2be484e29d52e9a6e7cfde3122b" args="(uint32_t *w, int i, uint32_t *in)" -->
static void&#160;</td><td class="memItemRight" valign="bottom"><b>__sha256_load_op</b> (uint32_t *w, int i, uint32_t *in)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac60d5ccb749f600937285404a87671a1"></a><!-- doxytag: member="sha256.c::__sha256_blend_op" ref="ac60d5ccb749f600937285404a87671a1" args="(uint32_t *w, int i)" -->
static void&#160;</td><td class="memItemRight" valign="bottom"><b>__sha256_blend_op</b> (uint32_t *w, int i)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae19e386ae1018a86c44dcb8a49e0c89d"></a><!-- doxytag: member="sha256.c::__sha256_transform" ref="ae19e386ae1018a86c44dcb8a49e0c89d" args="(uint32_t *digest, uint32_t *in)" -->
static void&#160;</td><td class="memItemRight" valign="bottom"><b>__sha256_transform</b> (uint32_t *digest, uint32_t *in)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14b805de5efeb757b4d87047ef3f252d"></a><!-- doxytag: member="sha256.c::sha256_transform" ref="a14b805de5efeb757b4d87047ef3f252d" args="(sha256_ctx *ctx)" -->
static void&#160;</td><td class="memItemRight" valign="bottom"><b>sha256_transform</b> (<a class="el" href="structsha256__ctx.html">sha256_ctx</a> *ctx)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1cc16ff33de011a426ce953b41a6da9e"></a><!-- doxytag: member="sha256.c::__sha256_update" ref="ga1cc16ff33de011a426ce953b41a6da9e" args="(sha256_ctx *ctx, uint8_t *buf, size_t len)" -->
NV_IMPL void&#160;</td><td class="memItemRight" valign="bottom"><b>__sha256_update</b> (<a class="el" href="structsha256__ctx.html">sha256_ctx</a> *ctx, <a class="el" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2">uint8_t</a> *buf, size_t len)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_IMPL void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SHA-256__224.html#ga8b34382e94f499437c3645f912be9731">sha256_final</a> (<a class="el" href="structsha256__ctx.html">sha256_ctx</a> *ctx, void *digest)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取SHA256校验值  <a href="group__SHA-256__224.html#ga8b34382e94f499437c3645f912be9731"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
变量</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>K</b> [64]</td></tr>
</table>
<hr/><a name="_details"></a><h2>详细描述</h2>
<div class="textblock"><p>Implements for SHA-256. </p>
<p>Copyright (C) 2012-2022, Henry Kwok 郭弘扬. All rights reserved </p>

<p>在文件<a class="el" href="sha256_8c_source.html">sha256.c</a>中定义。</p>
</div><hr/><h2>宏定义文档</h2>
<a class="anchor" id="a42259efd91a445a93c2151d124c1db65"></a><!-- doxytag: member="sha256.c::ROUND" ref="a42259efd91a445a93c2151d124c1db65" args="(a, b, c, d, e, f, g, h, t1, t2, I)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ROUND</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">d, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">e, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">f, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">g, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">h, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">t1, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">t2, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">I&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>值:</b><div class="fragment"><pre class="fragment">(t1) = (h) + E1(e) + Ch(e, f, g) + K[i + I] + w[i + I];     \
    (t2) = E0(a) + Maj(a, b, c); (d) += (t1); (h) = (t1) + (t2);
</pre></div>
<p>在文件<a class="el" href="sha256_8c_source.html">sha256.c</a>第<a class="el" href="sha256_8c_source.html#l00050">50</a>行定义。</p>

</div>
</div>
<hr/><h2>变量文档</h2>
<a class="anchor" id="a22c6551e88df4c5c42fce3d0641adb64"></a><!-- doxytag: member="sha256.c::K" ref="a22c6551e88df4c5c42fce3d0641adb64" args="[64]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const uint32_t K[64]<code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>初始化序列：</b><div class="fragment"><pre class="fragment"> {
    0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
    0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
    0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
    0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
    0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
    0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
    0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
    0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
    0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
    0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
    0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
    0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
    0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
    0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
    0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
    0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
}
</pre></div>
<p>在文件<a class="el" href="sha256_8c_source.html">sha256.c</a>第<a class="el" href="sha256_8c_source.html#l00023">23</a>行定义。</p>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>数据结构</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2015年七月16日 星期四 12:00:38 for Navo Portable Library by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>
